package com.loooooo.pm2024.config;


import com.loooooo.pm2024.web.session.MySessionFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterConfig {

    @Bean
    public FilterRegistrationBean registerMySessionFilter(){
        FilterRegistrationBean<MySessionFilter> bean = new FilterRegistrationBean<>();
        bean.setOrder(Integer.MIN_VALUE);
        bean.setFilter(new MySessionFilter());
        return bean;
    }
//    @Bean
//    public FilterRegistrationBean registerSessionPersistenceFilter(){
//        FilterRegistrationBean<SessionPersistenceFilter> bean = new FilterRegistrationBean<>();
//        bean.setOrder(1);
//        bean.setFilter(new SessionPersistenceFilter());
//        // 匹配"/hello/"下面的所有url
//        //bean.addUrlPatterns("/hello/*");
//        return bean;
//    }
}
